package com.hw.core.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class PasswordUtil {
    public static  String getPasswordByUsernameAndPassword(String name,String password){
        Object salt = ByteSource.Util.bytes( name);
        int hashIterations = 1024;// 加密次数
        Object result = new SimpleHash( "MD5", password, salt, hashIterations );
        return result.toString();
    }
}
